#!/bin/bash

echo "编译C++栈实现..."
g++ -std=c++11 -o stack stack.cpp

if [ $? -eq 0 ]; then
    echo "编译成功！运行程序..."
    echo "=================="
    ./stack
    echo "=================="
    echo "程序运行完成"
else
    echo "编译失败！"
fi
